Add hidden fossils: persistent meta-collectibles - #5
Merged
Conversation
- Fossil entity (src/fossil.ts): bone with warm unearthed glow, bob, sparkle; 30x26 hitbox, re-collectable each run for 150 points. - 3 hidden fossils per hand-built level (9 total), placed on risky ledges, stepping stones and behind the frostpeak gates. - Persistent codex (store.ts tinyrex_fossils): first discovery is recorded by id "levelIdx:i"; re-runs pay score again. - Game wiring: pickup via player collision, first-find status + shake + NEW FOSSIL text, HUD line with bone glyph, menu fossil dots on level cards, lifetime stats line, quest panel row. - Tests: fossil entity/store/level-data integrity + game integration (137 tests total); headless E2E verified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds hidden fossils — a persistent exploration reward that turns every hand-built level into a secret hunt.
src/fossil.ts— newFossilentity: a bone with a warm unearthed glow, a heavy bob, a weathering crack and an occasional sparkle. 30×26 hitbox; noupdate()(matches the crystal/heart pickup pattern, animated byt).level-data.tson risky ledges, stepping stones over lava, and behind the Frostpeak gates. Daily levels have none (the field is optional; a-1sentinel keeps ids stable).store.ts(tinyrex_fossils): the first discovery of eachlevelIdx:iid is recorded once and survives across runs; later runs re-collect the same fossil for 150 points again (CFG.score.fossil).game.ts,player.ts,ctx.ts): pickup through the existing player-collision loop; a first-find shows aFossil found! n/9status, aNEW FOSSIL!floating text, a bigger burst and a small shake. The HUD gains aFossils n/9line with a bone glyph; the menu shows per-level fossil dots on the cards, aFOSSILS n/9lifetime-stat, and a new quest row.'fossil'SFX inaudio.ts(unearth thud + warm chime).Why
Gives the game an exploration/replayability hook for almost zero new-engine cost — it reuses the crystal pickup pattern almost verbatim. It also seeds the payoff loop for the upcoming Rex skins (Mint unlocks via fossils).
Validation (local gate — CI is failing for pre-existing unrelated reasons)
npm run typecheck✓npm test— 137/137 (was 123; +14: fossil entity/store/level-data integrity + game integration, incl. a real player-collision pickup and respawn re-collection) ✓npm run build— single file 109.5 kB / 33.9 kB gzip ✓npm run lint— clean ✓0:0and0:1collected via real physics and persisted totinyrex_fossils; respawn resetscollectedflags so fossils are re-collectable; zero page errors. HUD + menu screenshots verified (bone-glyph HUD line, bright/dim dots on the level cards).Temp E2E artifacts were deleted before lint.